/* ----------------------------------------------------------------------------
* File: api_command_dispatcher.h
*
* Desc: Dispatcher for command messages
*
* Created: 06/09/2011, by Alexey Korshunov
* ---------------------------------------------------------------------------- */
#ifndef _API_COMMAND_DISPATCHER_
#define _API_COMMAND_DISPATCHER_

#include <memory>
#import "Skype4COM.dll" named_guids

namespace SkypeProtection
{
	/// Interface of dispatcher for command messages from Skype API
	class APICommandDispatcher
	{
	public:
		virtual ~APICommandDispatcher()
		{
		}
	};

	/// Interface of event handler for attaching process
	class APIAttachEventHandler
	{
	public:
		virtual ~APIAttachEventHandler()
		{
		}

		virtual void OnAttaching() = 0;
	};


	/// Message handler
	class APICommandHandler
	{
	public:
		virtual ~APICommandHandler()
		{
		}

		virtual void OnMessageStatus(SKYPE4COMLib::IChatMessage* pMessage, SKYPE4COMLib::TChatMessageStatus Status) = 0;
	};

	/// Structure to describe dispatcher params
	struct APICommandDispatcherParams
	{
		APICommandDispatcherParams()
			: AttachHandler(NULL)
			, CommandHandler(NULL)
		{
		}

		/// Handler for attaching process
		APIAttachEventHandler* AttachHandler;
		/// Message handler
		APICommandHandler* CommandHandler;
	};

	std::auto_ptr<APICommandDispatcher> CreateAPICommandDispatcher(const APICommandDispatcherParams& params);
}

#endif // _API_COMMAND_DISPATCHER_